import request from '@/utils/request'

// 获取组织架构的数据的接口
export function getDepartments() {
  return request({
    url: '/company/department'
  })
}

// 删除部门的接口
export function delDepartments(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}

// 新增部门的接口
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}

// 获取某个部门详情的接口
export function getDepartDetail(id) {
  return request({
    url: `/company/department/${id}`
  })
}

// 保存编辑数据的接口
export function updateDepartments(id, data) {
  return request({
    url: `/company/department/${id}`,
    method: 'PUT',
    data
  })
}
